package com.spcloud.fegin.client.service.impl;

import com.spcloud.common.entity.Order;
import com.spcloud.fegin.client.service.OrderService;
import org.springframework.stereotype.Component;

import java.util.ArrayList;
import java.util.List;

/**
 * @author GuoChunbo
 * @create 2020-03-19 9:00
 * @Description: 类的描述
 */
@Component //扫描
public class OrderServiceHystrixImpl implements OrderService {

    //请求方法失败后执行的默认实现
    @Override
    public List<Order> orderList() throws Exception{
        List<Order> orders = new ArrayList<>();
        orders.add(new Order(6,"订单名称6"));
        orders.add(new Order(7,"订单名称7"));
        orders.add(new Order(8,"订单名称8"));
        orders.add(new Order(9,"订单名称9"));
        orders.add(new Order(10,"订单名称10"));
        return orders;
    }
}
